<?php
/**
 * comment.inc.php
 */

if(!defined('IN_SITE') || !defined('IN_ADMIN')) {
	exit('Access Denied');
}
$op = in_array($op, array('list', 'add', 'del', 'verify', 'header')) ? $op : 'list';
$c = load('comment.class.php');

if($op == 'list')
{
	$commentlist = $c->show('', $type, "admincp.php?action=comment&op=list", $page, 25);
	$mutipage = $c->mutipage;
}
elseif ($op == 'del')
{
	if($delsubmit)
	{
		$ok = $c->del($commentid);
		tongji(11,$ok);
		showmessage("删除完成。", "?action=comment&op=list");
	}
}
elseif ($op == 'verify')
{
	if($dosubmit)
	{
		$ok = $c->verify($commentid);
		tongji(10,$ok);
		showmessage("审核完成。", "?action=comment&op=list");
	}
}
elseif ($op == 'header')
{
	if($contentid)
	{
		$contenturl = $db->result_first("SELECT url FROM {$tablepre}content WHERE contentid='$contentid'");
		header("Location: {$siteurl}$contenturl");
	}
}
include admin_tpl("comment");
?>